Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
node-fetch -- typeof import("[...]/node-fetch/index")' has no call signatures

Copied from here: https://github.com/node-fetch/node-fetch#json ... my code:

const fetch = require('node-fetch');

async function doFetch() {
    const response = await fetch('https://api.github.com/users/github');
    const data = await response.json();

    console.log(data);
}

doFetch()

Error message -- referring to the fetch('https://...) call:

This expression is not callable.
Type 'typeof import("[...]/node_modules/@types/node-fetch/index")' has no call signatures.

I've searched this and other sites, and this error seems pretty common with many modules, although I can only find fixes for examples using import instead of require. I'm guessing it's pretty simple, but I just can't figure out how to fix this with require syntax.

What am I doing wrong? Thanks in advance!


If it matters: JavaScript (not TypeScript). node.js. VSCode on Mac. The error message is generated by the dbaeumer.vscode-eslint plugin.


over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda